package handler

type ApiResp struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

func SuccessResp(data interface{}) ApiResp {
	return ApiResp{Code: 200, Msg: "success", Data: data}
}

func BadResp(errMsg string) ApiResp {
	return ApiResp{Code: 400, Msg: errMsg, Data: nil}
}

func FailResp(errMsg string) ApiResp {
	return ApiResp{Code: 500, Msg: errMsg, Data: nil}
}
